var orientation = 'vertical';

var div_name_scroll = '.component-scroller';
var div_name_text = '.component-text-scroller'
	
var div_height_extend;
var div_height = 500;
var ratio;


action = function() {
	slide = 100-$( div_name_scroll ).slider('value');
	/*switch (slide) {
	case 100:
		val = -ratio*100;
		break;
	case 0 : 
		val = 0;
		break;
	default:
		val = -ratio*slide;
	}*/
	val = -ratio*slide;
	
	$('.component-text-scroller').css({top: val+'px'});	
};

function init(divName){
	div_name_scroll = divName;
	$( div_name_scroll ).slider({
		orientation: orientation,
		range: "min",
		min: 0,
		max: 100,
		value: 100,
		slide: action
	});
	
	div_height_extend = $(div_name_text).css('height');
	div_height_extend = div_height_extend.replace('px', '');
	
	ratio = (div_height_extend - div_height)/100;
}